# Article Title: Female Representation in Legislative Committees and Perceptions of Legitimacy: Evidence from a Harmonized Experiment in Jordan, Morocco, and Tunisia
# Authors: Kritsen Kao, Ellen Lust, Marwa Shalaby, and Chagai Weiss
# Purpose: Code for online appendix figure and tables

#Load Relevant packages------
library("tidyverse")
library("estimatr")
library("ggplot2")
library("effectsize")
library("ggthemes")
library("texreg")
library("ltm")
library("stargazer")
library("RItools")
library("xtable")
library("MASS")
library("modelsummary")

#Load data for analyses
#Read in data----
gend_dat <- readRDS("replication_data/data_for_analysis.rds")
# Subset to experiments where issue area is domestic violence. These are the
# experiments used in the main analyses
gend_domv <-
 gend_dat %>% 
 filter(.,
        d_issue_dv == 1)


# Table A1-----

gend_dat <- 
 gend_dat %>% 
 mutate(.,
        Morocco = ifelse(x_cntry == "Morocco",1,0),
        Jordan = ifelse(x_cntry == "Jordan",1,0),
        Tunisia = ifelse(x_cntry == "Tunisia",1,0),
        Education = case_when(
         x_edu == "Less than high school" ~ 0,
         x_edu == "High school" ~ 1,
         x_edu == "Vocational degree/diploma" ~ 2,
         x_edu == "Bachelor degree" ~ 3,
         x_edu == "Masters, professional degree like J.D. or M.D., or PH.D." ~ 4
        ),
        Income = case_when(
         demo_q7 == "Our household income covers the needs well - we can save." ~ 0,
         demo_q7 == "Our household income covers the needs alright, without much difficulty." ~ 1,
         demo_q7 == "Our household income does not cover the needs, there are difficulties." ~ 2,
         demo_q7 == "Our household income does not cover the needs, there are great difficulties." ~ 3
        ),
        Married = ifelse(demo_q8 == "Married",1,0))

disc_table <-
 gend_dat %>% 
 dplyr::select(.,
               x_male, x_female, x_age, Morocco, Jordan, Tunisia, Education,
               Income, Married, m_sexism_ix, m_norms_ix)

# Output table
stargazer(as.data.frame(disc_table),
          covariate.labels = c("Male", "Female", "Age", "Moroccan", "Jordanian",
                               "Tunisian", "Education", "Income", "Married", 
                               "Sexism Index", "Norms Index"),
          title = "Descriptive Statistics -- Overall",
          label = "tab:dsc_ovrl",
          style = "qje",
          font.size = "tiny",
          notes.append = T,
          notes.align = "l",
          omit.summary.stat = c("p25", "p75"))


#Table A2------
# run balance test 
balance1 <- xBalance(d_gen_bal ~ x_male + x_female + x_age + Education +
                      Income + Married + m_sexism_ix + m_norms_ix,
                     na.rm = T,
                     data=gend_dat,
                     report=c("adj.mean.diffs", "z.scores", "p.values",
                              "chisquare.test"))

# Create balance table
table <- xtable(balance1,
                caption = 'Covariate Balance (Gender Treatment)',
                label = 'tab:balance1')
print(table,
      caption.placement = "top",
      size="\\tiny",
      label = tab:balance1,
      floating = T)



#Table A3-----
# run balance test 
balance2 <- xBalance(d_pro_dec ~ x_male + x_female + x_age + Education +
                      Income + Married + m_sexism_ix + m_norms_ix,
                     na.rm = T,
                     data=gend_dat,
                     report=c("adj.mean.diffs", "z.scores", "p.values",
                              "chisquare.test"))

# Create balance table
table2 <- xtable(balance2,
                 caption = 'Covariate Balance (Decision Treatment)',
                 label = 'tab:balance2')
print(table2,
      size="\\tiny",
      caption.placement = "top",
      label = tab:balance2,
      floating = T)


#Table A4-------
##Estimate regressions-----
h1_ix <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 

h1_ix_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h1_ix_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h1_ix_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

## Print table-----
texreg(list(h1_ix, h1_ix_jrd, h1_ix_tns, h1_ix_mrc),
       label = "tab:h1",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Committee Made Right Decision" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"
       ),
       fontsize = "scriptsize",
       caption = "ATE on Decision Evaluation (H1)")




#Table A5-------
##Estimate regressions-----

h1a <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_wm = standardize(y_right_dec_wm)) %>% 
 lm_robust(y_right_dec_wm ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 

h1a_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_wm = standardize(y_right_dec_wm)) %>% 
 lm_robust(y_right_dec_wm ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

h1a_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_wm = standardize(y_right_dec_wm)) %>% 
 lm_robust(y_right_dec_wm ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


h1a_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_wm = standardize(y_right_dec_wm)) %>% 
 lm_robust(y_right_dec_wm ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


## Print table-----
texreg(list(h1a, h1a_jrd, h1a_tns, h1a_mrc),
       label = "tab:h1a",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Committee Made Right Decision for Women" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"
       ),
       fontsize = "scriptsize",
       caption = "ATE on Decision Evaluation for Women (H1a)")


#Table A6-------
##Estimate regressions-----
h1b <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_mn = standardize(y_right_dec_mn)) %>% 
 lm_robust(y_right_dec_mn ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 

h1b_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_mn = standardize(y_right_dec_mn)) %>% 
 lm_robust(y_right_dec_mn ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h1b_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_mn = standardize(y_right_dec_mn)) %>% 
 lm_robust(y_right_dec_mn ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


h1b_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_mn = standardize(y_right_dec_mn)) %>% 
 lm_robust(y_right_dec_mn ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

##Print tables-----
texreg(list(h1b, h1b_jrd, h1b_tns, h1b_mrc),
       label = "tab:h1b",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Committee Made Right Decision for Men" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "ATE on Decision Evaluation for Men (H1b)")



#Table A7-------
##Estimate regressions-----
h1c <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_all = standardize(y_right_dec_all)) %>% 
 lm_robust(y_right_dec_all ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h1c_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_all = standardize(y_right_dec_all)) %>% 
 lm_robust(y_right_dec_all ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


h1c_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_all = standardize(y_right_dec_all)) %>% 
 lm_robust(y_right_dec_all ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


h1c_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_all = standardize(y_right_dec_all)) %>% 
 lm_robust(y_right_dec_all ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

##Print table-----
texreg(list(h1c, h1c_jrd, h1c_tns, h1c_mrc),
       label = "tab:h1c",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Committee Made Right Decision for All Citizens" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "ATE on Decision Evaluation for All Citizens")


#Table A8------
##Estimate regressions------
h2_ix <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .)

h2_ix_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h2_ix_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h2_ix_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

##Print table-----
texreg(list(h2_ix, h2_ix_jrd, h2_ix_tns, h2_ix_mrc),
       label = "tab:h2",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Evaluation of Committee (Index)" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "ATE on Evaluation of Committee (H2)")

#Table A9------
##Estimate regressions-----
h2a <-
 gend_domv %>% 
 mutate(.,
        y_trust_comit = standardize(y_trust_comit)) %>% 
 lm_robust(y_trust_comit ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h2a_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_trust_comit = standardize(y_trust_comit)) %>% 
 lm_robust(y_trust_comit ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


h2a_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_trust_comit = standardize(y_trust_comit)) %>% 
 lm_robust(y_trust_comit ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h2a_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)


##Print table-----

texreg(list(h2a, h2a_jrd, h2a_tns, h2a_mrc),
       label = "tab:h2a",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Trust in Committee" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "ATE on Trust in Committee (H2a)")


#Table A10------
##Estimate regressions-----
h2b <-
 gend_domv %>% 
 mutate(.,
        y_fair_comit = standardize(y_fair_comit)) %>% 
 lm_robust(y_fair_comit ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 

h2b_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_fair_comit = standardize(y_fair_comit)) %>% 
 lm_robust(y_fair_comit ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h2b_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_fair_comit = standardize(y_fair_comit)) %>% 
 lm_robust(y_fair_comit ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h2b_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_fair_comit = standardize(y_fair_comit)) %>% 
 lm_robust(y_fair_comit ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

##Print table-----
texreg(list(h2b, h2b_jrd, h2b_tns, h2b_mrc),
       label = "tab:h2b",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Committee is Fair" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "ATE on Perceptions of Committee Fairness (H2b)")



#Table A11------
## Estimate regressions--------
h3 <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .)

h3_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h3_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h3_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

## Print table-----
texreg(list(h3, h3_jrd, h3_tns, h3_mrc),
       label = "tab:h3",
       caption.above = T,
       include.ci = FALSE,
       custom.header = list("Will Public Accept Decision" = 1:4),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "ATE on Perceptions of Public Accepting Decision (H3)")


#Table A12-----
##Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
h4_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 


h4_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h4_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 


h4_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

###Outcome: Attitudes Towards Committee (Index)-----
h4_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 

h4_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h4_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

h4_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

### Outcome: Acceptance of Committee Decision------

h4_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 

h4_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

h4_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h4_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

##Print table-------
texreg(list(h4_rt_dec_pool, h4_rt_dec_jrd, h4_rt_dec_tns, h4_rt_dec_mrc,
            h4_att_cmt_pool, h4_att_cmt_jrd, h4_att_cmt_tns, h4_att_cmt_mrc,
            h4_accpt_cmt_pool, h4_accpt_cmt_jrd, h4_accpt_cmt_tns, h4_accpt_cmt_mrc),
       caption.above = T,
       label = "tab:h4",
       # scalebox = .5,
       include.ci = FALSE,
       custom.header = list("Committee Made Right Decision" = 1:4,
                            "Attitudes towards Committee" = 5:8,
                            "Public Accept Decision" = 9:12),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco",
                              "Pooled", "Jordan", "Tunisia", "Morocco",
                              "Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male",
                              "d_gen_bal:d_pro_dec" = "Balance*Decision"),
       fontsize = "tiny",
       digits= 1,
       caption = "Moderating Effect of Decision on Gender Balance (H4)")


#Table A13----
##Estimate regressions-----
###Outcome: Right decision-----
iss_bal_right <-
 gend_dat %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*d_issue_dv + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 

iss_dec_right <-
 gend_dat %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + d_issue_dv*d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 


###Outcome: Attitudes Towards Committee-----
iss_bal_att_cmt <-
 gend_dat %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*d_issue_dv + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 

iss_dec_att_cmt <-
 gend_dat %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + d_issue_dv*d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 



### Outcome: Public Accept Decision-----
iss_bal_accpt <-
 gend_dat %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*d_issue_dv + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 

iss_dec_accpt <-
 gend_dat %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + d_issue_dv*d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 

##Print table------
texreg(list(iss_bal_right, iss_dec_right, iss_bal_att_cmt, iss_dec_att_cmt,
            iss_bal_accpt, iss_dec_accpt),
       label = "tab:issue",
       caption.above = T,
       include.ci = FALSE,
       scalebox = .8,
       custom.header = list("Right Decision" = 1:2, "Attitudes towards Committee" = 3:4,
                            "Public Accept Decision" = 5:6),
       custom.model.names	= c("Jordan", "Jordan", "Jordan", "Jordan", "Jordan", "Jordan"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision (Support Proposal)",
                              "d_issue_dv" = "Domestic Violence Issue",
                              "d_gen_bal:d_issue_dv" = "Balance*DV Issue",
                              "d_issue_dv:d_pro_dec" = "Decision*DV Issue"),
       caption = "Moderating Effect of Issue Area on Main Treatments (Jordan)",
       custom.note = "All models control for age, education, and gender.")


#Table A14------
## Create Attrition Indicators------
gend_domv <- gend_domv %>% 
 mutate(.,
        att_h1 = ifelse(is.na(y_right_dec_ix),1,0),
        att_h2 = ifelse(is.na(y_att_comittee),1,0),
        att_h3 = ifelse(is.na(y_public_accept),1,0),
        overall_att = case_when(
         att_h1 == 1~ 1,
         att_h2 == 1~ 1,
         att_h3 == 1~ 1
        ),
        overall_att = ifelse(is.na(overall_att), 0,overall_att))
##Estimate regressions------
ovrl_att <-
 gend_domv %>% 
 lm_robust(overall_att ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


ovrl_jrd_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(overall_att ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


ovrl_tns_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 lm_robust(overall_att ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



ovrl_mrc_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 lm_robust(overall_att ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



h1_att <-
 gend_domv %>% 
 lm_robust(att_h1 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h1_jrd_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(att_h1 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h1_tns_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 lm_robust(att_h1 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



h1_mrc_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 lm_robust(att_h1 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h2_att <-
 gend_domv %>% 
 lm_robust(att_h2 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h2_jrd_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(att_h2 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h2_tns_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 lm_robust(att_h2 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



h2_mrc_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 lm_robust(att_h2 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



h3_att <-
 gend_domv %>% 
 lm_robust(att_h3 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



h3_jrd_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(att_h3 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 


h3_tns_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 lm_robust(att_h3 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 



h3_mrc_att <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 lm_robust(att_h3 ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 




##Print table-----
texreg(list(ovrl_att, ovrl_jrd_att, ovrl_tns_att, ovrl_mrc_att,
            h1_att, h1_jrd_att, h1_tns_att, h1_mrc_att,
            h2_att, h2_jrd_att, h2_tns_att, h2_mrc_att,
            h3_att, h3_jrd_att, h3_tns_att, h3_mrc_att),
       label = "tab:att",
       caption.above = T,
       no.margin = T,
       include.ci = FALSE,
       custom.header = list("Overall Attrition" = 1:4,
                            "Right Decision" = 5:8,
                            "Attitudes" = 9:12,
                            "Public Accept" = 13:16),
       custom.model.names	= c("Pool", "JRD", 
                              "TNS", "MRC",
                              "Pool", "JRD", 
                              "TNS", "MRC",
                              "Pool", "JRD", 
                              "TNS", "MRC",
                              "Pool", "JRD", 
                              "TNS", "MRC"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "Attrition By Country -- Treatment Effects on Non-Response",
       font.size = "tiny")


#Table A15-----
##Estimate regressions------
mnp_gndr_reg <-
 gend_domv %>% 
 lm_robust(manip_gend_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .)

mnp_gndr_reg_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(manip_gend_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

mnp_gndr_reg_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 lm_robust(manip_gend_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

mnp_gndr_reg_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 lm_robust(manip_gend_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

mnp_dec_reg <-
 gend_domv %>% 
 lm_robust(manip_dec_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .)


mnp_dec_reg_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 lm_robust(manip_dec_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

mnp_dec_reg_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 lm_robust(manip_dec_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

mnp_dec_reg_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 lm_robust(manip_dec_sucess ~
            d_gen_bal + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)

##Print table-----
texreg(list(mnp_gndr_reg, mnp_gndr_reg_jrd, mnp_gndr_reg_tns, mnp_gndr_reg_mrc,
            mnp_dec_reg, mnp_dec_reg_jrd, mnp_dec_reg_tns, mnp_dec_reg_mrc),
       caption.above = T,
       label = "tab:manip",
       include.ci = FALSE,
       custom.header = list("Recall Gender Balance?" = 1:4, 
                            "Recall Decision" = 5:8),
       custom.model.names	= c("Pooled", "Jordan", "Tunisia", "Morocco",
                              "Pooled", "Jordan", "Tunisia", "Morocco"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision (Pro)",
                              "x_age" = "Age",
                              "x_eduHigh school" = "High School",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"),
       fontsize = "scriptsize",
       caption = "Correlates of Correct Response",
       custom.note = "The outcome variable in these regression takes a value of 1 if respondent correctly answers manipulation check.")


#Table A16------
##Estimate regressions------
oredred_logit_h1 <- polr(as.factor(y_right_dec_ix) ~ 
                          d_gen_bal + d_pro_dec + x_age + x_edu + 
                          x_male + as.factor(x_cntry),
                         Hess = T,
                         data = gend_domv)

oredred_logit_h2 <- polr(as.factor(y_att_comittee) ~ 
                          d_gen_bal + d_pro_dec + x_age + x_edu + 
                          x_male + as.factor(x_cntry), 
                         Hess = T,
                         data = gend_domv)


oredred_logit_h3 <- polr(as.factor(y_public_accept) ~ 
                          d_gen_bal + d_pro_dec + x_age + x_edu + 
                          x_male + as.factor(x_cntry), 
                         Hess = T,
                         data = gend_domv)


##Print table------
texreg(list(oredred_logit_h1, oredred_logit_h2, oredred_logit_h3),
       label = "tab:logit",
       caption.above = T,
       include.ci = FALSE,
       #  custom.header = list("Committee Made Right Decision" = 1:4),
       custom.model.names	= c("Right Decision", 
                              "Attitudes towrds Committee",
                              "Public Accept"),
       custom.coef.map = list("d_gen_bal" = "Gender Balance",
                              "d_pro_dec" = "Decision",
                              "x_age" = "Age",
                              "x_eduVocational degree/diploma" = "Vocational Diploma",
                              "x_eduBachelor degree" = "BA",
                              "x_eduMasters, professional degree like J.D. or M.D., or PH.D." = "MA/PHD",
                              "x_eduDon't Know/Refuse to Answer" = "NA Edu",
                              "x_male" = "Male"
       ),
       fontsize = "scriptsize",
       caption = "Main Results: Ordered Logit")


#Figure A1------

ggplot(gend_domv, aes(x=y_right_dec_ix)) + 
 geom_histogram()+
 facet_grid(~x_cntry)+
 labs(x=expression(paste('Right Decision Index (', alpha, '=.804)')),
      y="Count")+
 theme(text = element_text(size = 12, family = "Times"),
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A2------

ggplot(gend_domv, aes(x=y_att_comittee)) + 
 geom_histogram()+
 facet_grid(~x_cntry)+
 labs(x=expression(paste('Right Decision Index (', alpha, '=.668)')),
      y="Count")+
 theme(text = element_text(size = 12, family = "Times"),
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A3------

ggplot(gend_domv, aes(x=y_public_accept)) + 
 geom_histogram()+
 scale_x_continuous(breaks = 1:4,
                    labels = paste0(c("Not at \nall likely", 
                                      "Not \nlikely", "Likely", "Very \nlikely")))+
 facet_grid(~x_cntry)+
 labs(x="Will Public Accept Committee Decision?",
      y="Count")+
 theme(text = element_text(size = 12, family = "Times"),
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 8),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A4------

gend_domv$vignette_real <- 
 factor(gend_domv$vignette_real, 
        c("Yes", "No", "Don't Know \nRefuse to \nAnswer"))
ggplot(gend_domv, aes(x=vignette_real)) + 
 geom_bar()+
 facet_grid(~x_cntry)+
 labs(x=expression(paste('Could You Imagine a Real Committee Disucussing...')),
      y="Count")+
 theme(text = element_text(size = 12, family = "Times"),
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A5------
##Estimate regressions-----
###Outcome: Right Decision------
h5a_sxsm_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h5a_sxsm_rt_dec_pool_p <- 
 tidy(h5a_sxsm_rt_dec_pool) %>%
 # mutate_if(is.numeric, round, 3) %>% 
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


h5a_sxsm_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_sxsm_rt_dec_jrd_p <-
 tidy(h5a_sxsm_rt_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


h5a_sxsm_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5a_sxsm_rt_dec_tns_p <- 
 tidy(h5a_sxsm_rt_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



h5a_sxsm_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_sxsm_rt_dec_mrc_p<-
 tidy(h5a_sxsm_rt_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
h5a_sxsm_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5a_sxsm_att_cmt_pool_p <-
 tidy(h5a_sxsm_att_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5a_sxsm_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_sxsm_att_cmt_jrd_p <-
 tidy(h5a_sxsm_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


h5a_sxsm_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5a_sxsm_att_cmt_tns_p <-
 tidy(h5a_sxsm_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5a_sxsm_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5a_sxsm_att_cmt_mrc_p <-
 tidy(h5a_sxsm_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

h5a_sxsm_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5a_sxsm_accpt_cmt_pool_p <-
 tidy(h5a_sxsm_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




h5a_sxsm_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5a_sxsm_accpt_cmt_jrd_p <- 
 tidy(h5a_sxsm_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


h5a_sxsm_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_sxsm_accpt_cmt_tns_p <-
 tidy(h5a_sxsm_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



h5a_sxsm_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_sxsm_accpt_cmt_mrc_p <-
 tidy(h5a_sxsm_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ix",
                    "d_gen_bal:m_sexism_ix")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")


##Print figure------
h5a_sxsm_coef <- 
 rbind(h5a_sxsm_rt_dec_pool_p, h5a_sxsm_rt_dec_jrd_p, h5a_sxsm_rt_dec_tns_p, h5a_sxsm_rt_dec_mrc_p,
       h5a_sxsm_att_cmt_pool_p, h5a_sxsm_att_cmt_jrd_p, h5a_sxsm_att_cmt_tns_p, h5a_sxsm_att_cmt_mrc_p,
       h5a_sxsm_accpt_cmt_pool_p, h5a_sxsm_accpt_cmt_jrd_p, h5a_sxsm_accpt_cmt_tns_p, h5a_sxsm_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "m_sexism_ix" ~ "Sexism \nIndex",
         term == "d_gen_bal:m_sexism_ix" ~ "Balance*\nSexism",
        ))


# Set order of outcomes and countries
h5a_sxsm_coef$Sample <- factor(h5a_sxsm_coef$Sample, 
                               c("Pooled",
                                 "Jordan",
                                 "Tunisia",
                                 "Morocco"
                               ))

h5a_sxsm_coef$Outcome <- factor(h5a_sxsm_coef$Outcome, 
                                c("Right \nDecision \nIndex",
                                  "Attitude \nTowards \nCommittee \nIndex",
                                  "Public \nAccept \nDecision"
                                ))

h5a_sxsm_coef$term <- factor(h5a_sxsm_coef$term, 
                             c("Balance*\nSexism",
                               "Sexism \nIndex",
                               "Gender \nBalance"
                             ))

h5a_sxsm_pos <- c("Pooled",
                  "Jordan",
                  "Tunisia",
                  "Morocco")

ggplot(h5a_sxsm_coef, aes(x=estimate, y=term, 
                          color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, linewidth = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))

#Figure A6-----
##Estimate regressions------
###Outcome: Right Decision------
h5a_hs_sxsm_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h5a_hs_sxsm_rt_dec_pool_p <- 
 tidy(h5a_hs_sxsm_rt_dec_pool) %>%
 # mutate_if(is.numeric, round, 3) %>% 
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


h5a_hs_sxsm_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_rt_dec_jrd_p <-
 tidy(h5a_hs_sxsm_rt_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


h5a_hs_sxsm_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5a_hs_sxsm_rt_dec_tns_p <- 
 tidy(h5a_hs_sxsm_rt_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



h5a_hs_sxsm_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_rt_dec_mrc_p<-
 tidy(h5a_hs_sxsm_rt_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
h5a_hs_sxsm_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_att_cmt_pool_p <-
 tidy(h5a_hs_sxsm_att_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5a_hs_sxsm_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_att_cmt_jrd_p <-
 tidy(h5a_hs_sxsm_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


h5a_hs_sxsm_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5a_hs_sxsm_att_cmt_tns_p <-
 tidy(h5a_hs_sxsm_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5a_hs_sxsm_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5a_hs_sxsm_att_cmt_mrc_p <-
 tidy(h5a_hs_sxsm_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

h5a_hs_sxsm_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_accpt_cmt_pool_p <-
 tidy(h5a_hs_sxsm_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




h5a_hs_sxsm_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5a_hs_sxsm_accpt_cmt_jrd_p <- 
 tidy(h5a_hs_sxsm_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


h5a_hs_sxsm_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_accpt_cmt_tns_p <-
 tidy(h5a_hs_sxsm_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



h5a_hs_sxsm_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_hos_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_hs_sxsm_accpt_cmt_mrc_p <-
 tidy(h5a_hs_sxsm_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_hos_sexism_ix",
                    "d_gen_bal:m_hos_sexism_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")


##Print figure------
h5a_hs_sxsm_coef <- 
 rbind(h5a_hs_sxsm_rt_dec_pool_p, h5a_hs_sxsm_rt_dec_jrd_p, h5a_hs_sxsm_rt_dec_tns_p, h5a_hs_sxsm_rt_dec_mrc_p,
       h5a_hs_sxsm_att_cmt_pool_p, h5a_hs_sxsm_att_cmt_jrd_p, h5a_hs_sxsm_att_cmt_tns_p, h5a_hs_sxsm_att_cmt_mrc_p,
       h5a_hs_sxsm_accpt_cmt_pool_p, h5a_hs_sxsm_accpt_cmt_jrd_p, h5a_hs_sxsm_accpt_cmt_tns_p, h5a_hs_sxsm_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "m_hos_sexism_ix" ~ "Hostile \nSexism \nIndex",
         term == "d_gen_bal:m_hos_sexism_ix" ~ "Balance*\nH. Sexism",
        ))


# Set order of outcomes and countries
h5a_hs_sxsm_coef$Sample <- factor(h5a_hs_sxsm_coef$Sample, 
                                  c("Pooled",
                                    "Jordan",
                                    "Tunisia",
                                    "Morocco"
                                  ))

h5a_hs_sxsm_coef$Outcome <- factor(h5a_hs_sxsm_coef$Outcome, 
                                   c("Right \nDecision \nIndex",
                                     "Attitude \nTowards \nCommittee \nIndex",
                                     "Public \nAccept \nDecision"
                                   ))

h5a_hs_sxsm_coef$term <- factor(h5a_hs_sxsm_coef$term, 
                                c("Balance*\nH. Sexism",
                                  "Hostile \nSexism \nIndex",
                                  "Gender \nBalance"
                                ))

h5a_hs_sxsm_pos <- c("Pooled",
                     "Jordan",
                     "Tunisia",
                     "Morocco")

ggplot(h5a_hs_sxsm_coef, aes(x=estimate, y=term, 
                             color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))



# Figure A7----------
##Estimate regressions----
###Outcome: Right Decision------
h5a_bn_sxsm_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h5a_bn_sxsm_rt_dec_pool_p <- 
 tidy(h5a_bn_sxsm_rt_dec_pool) %>%
 # mutate_if(is.numeric, round, 3) %>% 
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


h5a_bn_sxsm_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_rt_dec_jrd_p <-
 tidy(h5a_bn_sxsm_rt_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


h5a_bn_sxsm_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5a_bn_sxsm_rt_dec_tns_p <- 
 tidy(h5a_bn_sxsm_rt_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



h5a_bn_sxsm_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_rt_dec_mrc_p<-
 tidy(h5a_bn_sxsm_rt_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
h5a_bn_sxsm_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_att_cmt_pool_p <-
 tidy(h5a_bn_sxsm_att_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5a_bn_sxsm_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_att_cmt_jrd_p <-
 tidy(h5a_bn_sxsm_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


h5a_bn_sxsm_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5a_bn_sxsm_att_cmt_tns_p <-
 tidy(h5a_bn_sxsm_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5a_bn_sxsm_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5a_bn_sxsm_att_cmt_mrc_p <-
 tidy(h5a_bn_sxsm_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>%  
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

h5a_bn_sxsm_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_accpt_cmt_pool_p <-
 tidy(h5a_bn_sxsm_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>%  
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




h5a_bn_sxsm_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5a_bn_sxsm_accpt_cmt_jrd_p <- 
 tidy(h5a_bn_sxsm_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


h5a_bn_sxsm_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_accpt_cmt_tns_p <-
 tidy(h5a_bn_sxsm_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



h5a_bn_sxsm_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_ben_sexism_ix + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5a_bn_sxsm_accpt_cmt_mrc_p <-
 tidy(h5a_bn_sxsm_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_ben_sexism_ix",
                    "d_gen_bal:m_ben_sexism_ix")) %>%  
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")


##Print figure------
h5a_bn_sxsm_coef <- 
 rbind(h5a_bn_sxsm_rt_dec_pool_p, h5a_bn_sxsm_rt_dec_jrd_p, h5a_bn_sxsm_rt_dec_tns_p, h5a_bn_sxsm_rt_dec_mrc_p,
       h5a_bn_sxsm_att_cmt_pool_p, h5a_bn_sxsm_att_cmt_jrd_p, h5a_bn_sxsm_att_cmt_tns_p, h5a_bn_sxsm_att_cmt_mrc_p,
       h5a_bn_sxsm_accpt_cmt_pool_p, h5a_bn_sxsm_accpt_cmt_jrd_p, h5a_bn_sxsm_accpt_cmt_tns_p, h5a_bn_sxsm_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "m_ben_sexism_ix" ~ "Benevolent \nSexism \nIndex",
         term == "d_gen_bal:m_ben_sexism_ix" ~ "Balance*\nB. Sexism",
        ))


# Set order of outcomes and countries
h5a_bn_sxsm_coef$Sample <- factor(h5a_bn_sxsm_coef$Sample, 
                                  c("Pooled",
                                    "Jordan",
                                    "Tunisia",
                                    "Morocco"
                                  ))

h5a_bn_sxsm_coef$Outcome <- factor(h5a_bn_sxsm_coef$Outcome, 
                                   c("Right \nDecision \nIndex",
                                     "Attitude \nTowards \nCommittee \nIndex",
                                     "Public \nAccept \nDecision"
                                   ))

h5a_bn_sxsm_coef$term <- factor(h5a_bn_sxsm_coef$term, 
                                c("Balance*\nB. Sexism",
                                  "Benevolent \nSexism \nIndex",
                                  "Gender \nBalance"
                                ))

h5a_bn_sxsm_pos <- c("Pooled",
                     "Jordan",
                     "Tunisia",
                     "Morocco")

ggplot(h5a_bn_sxsm_coef, aes(x=estimate, y=term, 
                             color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A8-------
#Estimate regressions-----
# Recode alterantive measure of moderator
# Sexism = 1 if m_sexism_ix>mean, Sexism = 0 if m_sexism_ix< mean
mean(gend_domv$m_sexism_ix, na.rm = T)
gend_domv<-
 gend_domv %>% 
 mutate(.,
        m_sexism_ba = case_when(
         m_sexism_ix > 0.6299239 ~ 1,
         m_sexism_ix < 0.6299239 ~ 0
        ))


###Outcome: Right Decision------

bin_sxsm_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
bin_sxsm_rt_dec_pool_p <- 
 tidy(bin_sxsm_rt_dec_pool) %>%
 # mutate_if(is.numeric, round, 3) %>% 
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


bin_sxsm_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
bin_sxsm_rt_dec_jrd_p <-
 tidy(bin_sxsm_rt_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


bin_sxsm_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

bin_sxsm_rt_dec_tns_p <- 
 tidy(bin_sxsm_rt_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



bin_sxsm_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
bin_sxsm_rt_dec_mrc_p<-
 tidy(bin_sxsm_rt_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
bin_sxsm_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
bin_sxsm_att_cmt_pool_p <-
 tidy(bin_sxsm_att_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



bin_sxsm_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
bin_sxsm_att_cmt_jrd_p <-
 tidy(bin_sxsm_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


bin_sxsm_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
bin_sxsm_att_cmt_tns_p <-
 tidy(bin_sxsm_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



bin_sxsm_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

bin_sxsm_att_cmt_mrc_p <-
 tidy(bin_sxsm_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

bin_sxsm_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
bin_sxsm_accpt_cmt_pool_p <-
 tidy(bin_sxsm_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




bin_sxsm_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
bin_sxsm_accpt_cmt_jrd_p <- 
 tidy(bin_sxsm_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


bin_sxsm_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
bin_sxsm_accpt_cmt_tns_p <-
 tidy(bin_sxsm_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



bin_sxsm_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_sexism_ba + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
bin_sxsm_accpt_cmt_mrc_p <-
 tidy(bin_sxsm_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_sexism_ba",
                    "d_gen_bal:m_sexism_ba")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")


##Print Figure------
bin_sxsm_coef <- 
 rbind(bin_sxsm_rt_dec_pool_p, bin_sxsm_rt_dec_jrd_p, bin_sxsm_rt_dec_tns_p, bin_sxsm_rt_dec_mrc_p,
       bin_sxsm_att_cmt_pool_p, bin_sxsm_att_cmt_jrd_p, bin_sxsm_att_cmt_tns_p, bin_sxsm_att_cmt_mrc_p,
       bin_sxsm_accpt_cmt_pool_p, bin_sxsm_accpt_cmt_jrd_p, bin_sxsm_accpt_cmt_tns_p, bin_sxsm_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "m_sexism_ba" ~ "Sexism \nBinary",
         term == "d_gen_bal:m_sexism_ba" ~ "Balance*\nSexism",
        ))


# Set order of outcomes and countries
bin_sxsm_coef$Sample <- factor(bin_sxsm_coef$Sample, 
                               c("Pooled",
                                 "Jordan",
                                 "Tunisia",
                                 "Morocco"
                               ))

bin_sxsm_coef$Outcome <- factor(bin_sxsm_coef$Outcome, 
                                c("Right \nDecision \nIndex",
                                  "Attitude \nTowards \nCommittee \nIndex",
                                  "Public \nAccept \nDecision"
                                ))

bin_sxsm_coef$term <- factor(bin_sxsm_coef$term, 
                             c("Balance*\nSexism",
                               "Sexism \nBinary",
                               "Gender \nBalance"
                             ))

h5a_sxsm_pos <- c("Pooled",
                  "Jordan",
                  "Tunisia",
                  "Morocco")

ggplot(bin_sxsm_coef, aes(x=estimate, y=term, 
                          color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A9-------
##Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
h5b_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_norms_ix + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h5b_rt_dec_pool_p <- 
 tidy(h5b_rt_dec_pool) %>%
 # mutate_if(is.numeric, round, 3) %>% 
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


h5b_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5b_rt_dec_jrd_p <-
 tidy(h5b_rt_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


h5b_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5b_rt_dec_tns_p <- 
 tidy(h5b_rt_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



h5b_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5b_rt_dec_mrc_p<-
 tidy(h5b_rt_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
h5b_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5b_att_cmt_pool_p <-
 tidy(h5b_att_cmt_pool) %>%
 #mutate_if(is.numeric, round, 3) %>% 
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5b_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5b_att_cmt_jrd_p <-
 tidy(h5b_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


h5b_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5b_att_cmt_tns_p <-
 tidy(h5b_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



h5b_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

h5b_att_cmt_mrc_p <-
 tidy(h5b_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

h5b_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
h5b_accpt_cmt_pool_p <-
 tidy(h5b_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




h5b_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
h5b_accpt_cmt_jrd_p <- 
 tidy(h5b_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


h5b_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5b_accpt_cmt_tns_p <-
 tidy(h5b_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



h5b_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_norms_ix+d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
h5b_accpt_cmt_mrc_p <-
 tidy(h5b_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_norms_ix",
                    "d_gen_bal:m_norms_ix")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")


##Print Figure------
h5b_coef <- 
 rbind(h5b_rt_dec_pool_p, h5b_rt_dec_jrd_p, h5b_rt_dec_tns_p, h5b_rt_dec_mrc_p,
       h5b_att_cmt_pool_p, h5b_att_cmt_jrd_p, h5b_att_cmt_tns_p, h5b_att_cmt_mrc_p,
       h5b_accpt_cmt_pool_p, h5b_accpt_cmt_jrd_p, h5b_accpt_cmt_tns_p, h5b_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "m_norms_ix" ~ "Gender \nNorms",
         term == "d_gen_bal:m_norms_ix" ~ "Balance*\nNorms",
        ))


# Set order of outcomes and countries
h5b_coef$Sample <- factor(h5b_coef$Sample, 
                          c("Pooled",
                            "Jordan",
                            "Tunisia",
                            "Morocco"
                          ))

h5b_coef$Outcome <- factor(h5b_coef$Outcome, 
                           c("Right \nDecision \nIndex",
                             "Attitude \nTowards \nCommittee \nIndex",
                             "Public \nAccept \nDecision"
                           ))

h5b_coef$term <- factor(h5b_coef$term, 
                        c("Balance*\nNorms",
                          "Gender \nNorms",
                          "Gender \nBalance"
                        ))

h5b_pos <- c("Pooled",
             "Jordan",
             "Tunisia",
             "Morocco")

ggplot(h5b_coef, aes(x=estimate, y=term, 
                     color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))




#Figure A10-------
##Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
rt_dec_ml_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*x_male + d_pro_dec+
            x_age + x_edu,
           se_type = "HC0",
           fixed_effects = x_cntry,
           data = .) 
rt_dec_ml_pool_p <- 
 tidy(rt_dec_ml_pool) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*x_male + d_pro_dec+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_jrd_p <-
 tidy(rt_dec_ml_jrd) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) 

rt_dec_ml_tns_p <- 
 tidy(rt_dec_ml_tns) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



rt_dec_ml_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*x_male + d_pro_dec +  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_mrc_p<-
 tidy(rt_dec_ml_mrc) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

###Outcome: Attitudes Towards Committee (Index)-----
att_cmt_ml_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
att_cmt_ml_pool_p <-
 tidy(att_cmt_ml_pool) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
att_cmt_ml_jrd_p <-
 tidy(att_cmt_ml_jrd) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
att_cmt_ml_tns_p <-
 tidy(att_cmt_ml_tns) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*x_male + d_pro_dec +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

att_cmt_ml_mrc_p <-
 tidy(att_cmt_ml_mrc) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

accpt_cmt_ml_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_pool_p <-
 tidy(accpt_cmt_ml_pool) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .)
accpt_cmt_ml_jrd_p <- 
 tidy(accpt_cmt_ml_jrd) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*x_male + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_tns_p <-
 tidy(accpt_cmt_ml_tns) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*x_male + d_pro_dec +  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_mrc_p <-
 tidy(accpt_cmt_ml_mrc) %>%
 filter(term %in% c("d_gen_bal", "x_male",
                    "d_gen_bal:x_male")) %>%  
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print Figure------
male_hte <- 
 rbind(rt_dec_ml_pool_p, rt_dec_ml_jrd_p, rt_dec_ml_tns_p, rt_dec_ml_mrc_p,
       att_cmt_ml_pool_p, att_cmt_ml_jrd_p, att_cmt_ml_tns_p, att_cmt_ml_mrc_p,
       accpt_cmt_ml_pool_p, accpt_cmt_ml_jrd_p, accpt_cmt_ml_tns_p, accpt_cmt_ml_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "x_male" ~ "Male \nRespondent",
         term == "d_gen_bal:x_male" ~ "Balance*\nMale",
        ))


# Set order of outcomes and countries
male_hte$Sample <- factor(male_hte$Sample, 
                          c("Pooled",
                            "Jordan",
                            "Tunisia",
                            "Morocco"
                          ))

male_hte$Outcome <- factor(male_hte$Outcome, 
                           c("Right \nDecision \nIndex",
                             "Attitude \nTowards \nCommittee \nIndex",
                             "Public \nAccept \nDecision"
                           ))

male_pos <- c("Gender \nBalance",
              "Male \nRespondent",
              "Balance*\nMale") %>% rev()

ggplot(male_hte, aes(x=estimate, y=term, 
                     color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 scale_y_discrete(limits = male_pos)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A11----
## Create Weights for missingness in each outcome----
# Set missing covariates at 99
gend_domv <- 
 gend_domv %>% 
 mutate(.,
        avail_h1 = ifelse(is.na(y_right_dec_ix),0,1),
        avail_h2 = ifelse(is.na(y_att_comittee),0,1),
        avail_h3 = ifelse(is.na(y_public_accept),0,1),
        wx_age = ifelse(is.na(x_age), 99,x_age),
        wx_edu = ifelse(is.na(x_edu), "Missing",x_edu),
        wx_male = ifelse(is.na(x_male), 99,x_male),
        wx_cntry = ifelse(is.na(x_cntry), "Missing",x_cntry),
        wdemo_q7 = ifelse(is.na(demo_q7), "Missing",demo_q7),
        wdemo_q8 = ifelse(is.na(demo_q8), "Missing",demo_q8),
        wm_sexism_ix = ifelse(is.na(m_sexism_ix), 99,m_sexism_ix),
        wm_norms_ix = ifelse(is.na(m_norms_ix), 99,m_norms_ix)
 )

### Outcome in H1
fit_p_out1 <- 
 glm(avail_h1 ~ d_gen_bal*wx_age + d_gen_bal*wx_edu +
      d_gen_bal*wx_male +  d_gen_bal*wx_cntry + 
      d_gen_bal*wdemo_q7 +  d_gen_bal*wdemo_q8 +
      d_gen_bal*wm_sexism_ix +  d_gen_bal*wm_norms_ix +
      d_pro_dec*wx_age + d_pro_dec*wx_edu +
      d_pro_dec*wx_male +  d_pro_dec*wx_cntry + 
      d_pro_dec*wdemo_q7 +  d_pro_dec*wdemo_q8 +
      d_pro_dec*wm_sexism_ix +  d_pro_dec*wm_norms_ix +
      d_pro_dec*d_gen_bal,
     family = binomial(link = "logit"),
     data = gend_domv)
p_out1 <- fit_p_out1$fitted
wght_h1 <- 1/p_out1

### Outcome in H2
fit_p_out2 <- 
 glm(avail_h2 ~ d_gen_bal*wx_age + d_gen_bal*wx_edu +
      d_gen_bal*wx_male +  d_gen_bal*wx_cntry + 
      d_gen_bal*wdemo_q7 +  d_gen_bal*wdemo_q8 +
      d_gen_bal*wm_sexism_ix +  d_gen_bal*wm_norms_ix +
      d_pro_dec*wx_age + d_pro_dec*wx_edu +
      d_pro_dec*wx_male +  d_pro_dec*wx_cntry + 
      d_pro_dec*wdemo_q7 +  d_pro_dec*wdemo_q8 +
      d_pro_dec*wm_sexism_ix +  d_pro_dec*wm_norms_ix +
      d_pro_dec*d_gen_bal,
     family = binomial(link = "logit"),
     data = gend_domv)
p_out2 <- fit_p_out2$fitted
wght_h2 <- 1/p_out2


### Outcome in H3
fit_p_out3 <- 
 glm(avail_h3 ~ d_gen_bal*wx_age + d_gen_bal*wx_edu +
      d_gen_bal*wx_male +  d_gen_bal*wx_cntry + 
      d_gen_bal*wdemo_q7 +  d_gen_bal*wdemo_q8 +
      d_gen_bal*wm_sexism_ix +  d_gen_bal*wm_norms_ix +
      d_pro_dec*wx_age + d_pro_dec*wx_edu +
      d_pro_dec*wx_male +  d_pro_dec*wx_cntry + 
      d_pro_dec*wdemo_q7 +  d_pro_dec*wdemo_q8 +
      d_pro_dec*wm_sexism_ix +  d_pro_dec*wm_norms_ix +
      d_pro_dec*d_gen_bal,
     family = binomial(link = "logit"),
     data = gend_domv)
p_out3 <- fit_p_out3$fitted
wght_h3 <- 1/p_out3


##Estimate Weighted Regressions------
### Outcome: Right Decision------
h1_w_ix <-
 gend_domv %>%
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           weights = wght_h1,
           data = .) 
h1_w_ix_p <- 
 tidy(h1_w_ix) %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec"))%>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex",
        Model = "Weighted")

h1_nw_ix <-
 gend_domv %>%
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h1_nw_ix_p <- 
 tidy(h1_nw_ix) %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec"))%>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex",
        Model = "Not Weighted")


###Outcome: Attitudes towards committee-----
h2_w_ix <-
 gend_domv %>%
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           weights = wght_h2,
           data = .) 
h2_w_ix_p <- 
 tidy(h2_w_ix) %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec"))%>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitudes \nTowards \nCommitte \nIndex",
        Model = "Weighted")

h2_nw_ix <-
 gend_domv %>%
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h2_nw_ix_p <- 
 tidy(h2_nw_ix) %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec"))%>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitudes \nTowards \nCommitte \nIndex",
        Model = "Not Weighted")



###Outcome: Accept Decisions-----
h3_w <-
 gend_domv %>%
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           weights = wght_h3,
           data = .) 
h3_w_p <- 
 tidy(h3_w) %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec"))%>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision",
        Model = "Weighted")


h3_nw <-
 gend_domv %>%
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal +d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
h3_nw_p <- 
 tidy(h3_nw) %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec"))%>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision" ,
        Model = "Not Weighted")

##Print Figure----

ipw_models <- 
 rbind(h1_w_ix_p, h1_nw_ix_p, 
       h2_w_ix_p, h2_nw_ix_p, 
       h3_w_p, h3_nw_p) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "d_pro_dec" ~ "Committtee \nDecision"
        ))

ipw_models$Outcome <- factor(ipw_models$Outcome, 
                             c("Right \nDecision \nIndex",
                               "Attitudes \nTowards \nCommitte \nIndex",
                               "Public \nAccept \nDecision" 
                             ))

ipw_pos <- c("Committtee \nDecision", "Gender \nBalance")

ggplot(ipw_models, aes(x=estimate, y=term, 
                       color = Model, shape = Model)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 scale_color_brewer(palette = "Set1")+
 #scale_x_continuous(limits = -1:1) +
 scale_y_discrete(limits = ipw_pos)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A12-----
ggplot(gend_domv, aes(x=manip_gend_sucess))+
 geom_histogram(color="black", fill="white")+
 scale_x_continuous(breaks = 0:1,
                    labels = paste0(c("Wrong", 
                                      "Correct")))+
 labs(x= "Correct Recall on Gender Treatment",
      y = "Count")+
 facet_grid(~x_cntry)+
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 8),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A13-----
ggplot(gend_domv, aes(x=manip_dec_sucess))+
 geom_histogram(color="black", fill="white")+
 scale_x_continuous(breaks = 0:1,
                    labels = paste0(c("Wrong", 
                                      "Correct")))+
 labs(x= "Correct Recall on Gender Treatment",
      y = "Count")+
 facet_grid(~x_cntry)+
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 8),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


# Figure A14-------
## Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
end_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            endog_comitt_gend_bal+ endog_comitt_support+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
end_dec_pool_p <- 
 tidy(end_dec_pool) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


end_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            endog_comitt_gend_bal + endog_comitt_support+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
end_dec_jrd_p <-
 tidy(end_dec_jrd) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


end_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

end_dec_tns_p <- 
 tidy(end_dec_tns) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



end_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            endog_comitt_gend_bal + endog_comitt_support +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
end_dec_mrc_p<-
 tidy(end_dec_mrc) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

###Outcome: Attitudes Towards Committee (Index)-----
end_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
end_cmt_pool_p <-
 tidy(end_cmt_pool) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


end_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
end_att_cmt_jrd_p <-
 tidy(end_att_cmt_jrd) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")

end_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
end_att_cmt_tns_p <-
 tidy(end_att_cmt_tns) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



end_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            endog_comitt_gend_bal + endog_comitt_support +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

end_att_cmt_mrc_p <-
 tidy(end_att_cmt_mrc) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

end_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
end_accpt_cmt_pool_p <-
 tidy(end_accpt_cmt_pool) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")


end_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
end_accpt_cmt_jrd_p <- 
 tidy(end_accpt_cmt_jrd) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


end_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            endog_comitt_gend_bal + endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
end_accpt_cmt_tns_p <-
 tidy(end_accpt_cmt_tns) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



end_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            endog_comitt_gend_bal + endog_comitt_support +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
end_accpt_cmt_mrc_p <-
 tidy(end_accpt_cmt_mrc) %>%
 filter(term %in% c("endog_comitt_gend_bal", "endog_comitt_support")) %>%  
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print figure------
endog_coefs <- 
 rbind(end_dec_pool_p, end_dec_jrd_p, end_dec_tns_p, end_dec_mrc_p,
       end_cmt_pool_p,end_att_cmt_jrd_p,end_att_cmt_tns_p,end_att_cmt_mrc_p,
       end_accpt_cmt_pool_p, end_accpt_cmt_jrd_p,end_accpt_cmt_tns_p,end_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "endog_comitt_gend_bal" ~ "Gender \nBalance \n(Perceived)",
         term == "endog_comitt_support" ~ "Committee \nDecision \n(Perceived)"
        ))


# Set order of outcomes and countries
endog_coefs$Sample <- factor(endog_coefs$Sample, 
                             c("Pooled",
                               "Jordan",
                               "Tunisia",
                               "Morocco"
                             ))

endog_coefs$Outcome <- factor(endog_coefs$Outcome, 
                              c("Right \nDecision \nIndex",
                                "Attitude \nTowards \nCommittee \nIndex",
                                "Public \nAccept \nDecision"
                              ))

h4_pos <- c("Pooled",
            "Jordan",
            "Tunisia",
            "Morocco")

ggplot(endog_coefs, aes(x=estimate, y=term, 
                        color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A15-----
#Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
en_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*endog_comitt_support+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           data = .) 
en_dec_pool_p <- 
 tidy(en_dec_pool) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


en_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*endog_comitt_support+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
en_dec_jrd_p <-
 tidy(en_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


en_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

en_dec_tns_p <- 
 tidy(en_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



en_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*endog_comitt_support +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
en_dec_mrc_p<-
 tidy(en_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

##Outcome: Attitudes Towards Committee (Index)-----
en_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
en_cmt_pool_p <-
 tidy(en_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


en_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
en_att_cmt_jrd_p <-
 tidy(en_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")

en_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
en_att_cmt_tns_p <-
 tidy(en_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



en_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*endog_comitt_support +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

en_att_cmt_mrc_p <-
 tidy(en_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

en_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
en_accpt_cmt_pool_p <-
 tidy(en_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




en_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
en_accpt_cmt_jrd_p <- 
 tidy(en_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


en_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*endog_comitt_support +
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
en_accpt_cmt_tns_p <-
 tidy(en_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



en_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*endog_comitt_support +  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
en_accpt_cmt_mrc_p <-
 tidy(en_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "endog_comitt_support",
                    "d_gen_bal:endog_comitt_support")) %>%  
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print figure------
h4_coef <- 
 rbind(en_dec_pool_p, en_dec_jrd_p, en_dec_tns_p, en_dec_mrc_p,
       en_cmt_pool_p,en_att_cmt_jrd_p,en_att_cmt_tns_p,en_att_cmt_mrc_p,
       en_accpt_cmt_pool_p, en_accpt_cmt_jrd_p,en_accpt_cmt_tns_p,en_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "endog_comitt_support" ~ "Committee \nDecision \n(Perceived)",
         term == "d_gen_bal:endog_comitt_support" ~ "Balance*\nDecision",
        ))


# Set order of outcomes and countries
h4_coef$Sample <- factor(h4_coef$Sample, 
                         c("Pooled",
                           "Jordan",
                           "Tunisia",
                           "Morocco"
                         ))

h4_coef$Outcome <- factor(h4_coef$Outcome, 
                          c("Right \nDecision \nIndex",
                            "Attitude \nTowards \nCommittee \nIndex",
                            "Public \nAccept \nDecision"
                          ))

h4_pos <- c("Pooled",
            "Jordan",
            "Tunisia",
            "Morocco")

ggplot(h4_coef, aes(x=estimate, y=term, 
                    color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A16-------
##Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
rt_dec_ml_pool_en <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec+
            x_age + x_edu + x_cong_en,
           fixed_effects = x_cntry,
           data = .)  %>% tidy() %>% 
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_jrd_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec+
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



rt_dec_ml_mrc_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

###Outcome: Attitudes Towards Committee (Index)-----
att_cmt_ml_pool_en <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_jrd_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_tns_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

accpt_cmt_ml_pool_en <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>%  
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_jrd_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_tns_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_mrc_en <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_cong_en,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print figure------
enum <- 
 rbind(rt_dec_ml_pool_en, rt_dec_ml_jrd_en, rt_dec_ml_tns_en, rt_dec_ml_mrc_en,
       att_cmt_ml_pool_en, att_cmt_ml_jrd_en, att_cmt_ml_tns_en, att_cmt_ml_mrc_en,
       accpt_cmt_ml_pool_en, accpt_cmt_ml_jrd_en, accpt_cmt_ml_tns_en, accpt_cmt_ml_mrc_en
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "d_pro_dec" ~ "Pro Women \nDecision"
        ))


# Set order of outcomes and countries
enum$Sample <- factor(enum$Sample, 
                      c("Pooled",
                        "Jordan",
                        "Tunisia",
                        "Morocco"
                      ))

enum$Outcome <- factor(enum$Outcome, 
                       c("Right \nDecision \nIndex",
                         "Attitude \nTowards \nCommittee \nIndex",
                         "Public \nAccept \nDecision"
                       ))

enum_pos <- c("Gender \nBalance",
              "Pro Women \nDecision") %>% rev()

ggplot(enum, aes(x=estimate, y=term, 
                 color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 scale_y_discrete(limits = enum_pos)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))

#Figure A17------
##Estimate regressions----
###Outcome: Committee Made Right decision (Index)-----
rt_dec_ml_pool_int <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male*x_male_en + d_pro_dec+
            x_age + x_edu,
           fixed_effects = x_cntry,
           data = .)  %>% tidy() %>% 
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_jrd_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male*x_male_en + d_pro_dec+
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal +  x_male*x_male_en + d_pro_dec+
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



rt_dec_ml_mrc_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

###Outcome: Attitudes Towards Committee (Index)-----
att_cmt_ml_pool_int <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_jrd_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_tns_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

accpt_cmt_ml_pool_int <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>%  
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_jrd_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_tns_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_mrc_int <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male*x_male_en + d_pro_dec +
            x_age + x_edu,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print Figure------
enum_int <- 
 rbind(rt_dec_ml_pool_int, rt_dec_ml_jrd_int, rt_dec_ml_tns_int, rt_dec_ml_mrc_int,
       att_cmt_ml_pool_int, att_cmt_ml_jrd_int, att_cmt_ml_tns_int, att_cmt_ml_mrc_int,
       accpt_cmt_ml_pool_int, accpt_cmt_ml_jrd_int, accpt_cmt_ml_tns_int, accpt_cmt_ml_mrc_int
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "d_pro_dec" ~ "Pro Women \nDecision"
        ))


# Set order of outcomes and countries
enum_int$Sample <- factor(enum_int$Sample, 
                          c("Pooled",
                            "Jordan",
                            "Tunisia",
                            "Morocco"
                          ))

enum_int$Outcome <- factor(enum_int$Outcome, 
                           c("Right \nDecision \nIndex",
                             "Attitude \nTowards \nCommittee \nIndex",
                             "Public \nAccept \nDecision"
                           ))

enum_pos <- c("Gender \nBalance",
              "Pro Women \nDecision") %>% rev()

ggplot(enum_int, aes(x=estimate, y=term, 
                     color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 scale_y_discrete(limits = enum_pos)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A18-----
##Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
rt_dec_ml_pool2 <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec*x_male + d_gen_bal+
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
rt_dec_ml_pool_p2 <- 
 tidy(rt_dec_ml_pool2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_jrd2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec*x_male + d_gen_bal+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_jrd_p2 <-
 tidy(rt_dec_ml_jrd2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec*x_male + d_gen_bal+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 

rt_dec_ml_tns_p2 <- 
 tidy(rt_dec_ml_tns2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



rt_dec_ml_mrc2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec*x_male + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_mrc_p2<-
 tidy(rt_dec_ml_mrc2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

###Outcome: Attitudes Towards Committee (Index)-----
att_cmt_ml_pool2 <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec*x_male + d_gen_bal+  
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
att_cmt_ml_pool_p2 <-
 tidy(att_cmt_ml_pool2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>%
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_jrd2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec*x_male + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
att_cmt_ml_jrd_p2 <-
 tidy(att_cmt_ml_jrd2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_tns2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec*x_male + d_gen_bal+ 
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
att_cmt_ml_tns_p2 <-
 tidy(att_cmt_ml_tns2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec*x_male + d_gen_bal+  
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

att_cmt_ml_mrc_p2 <-
 tidy(att_cmt_ml_mrc2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

accpt_cmt_ml_pool2 <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec*x_male + d_gen_bal+  
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_pool_p2 <-
 tidy(accpt_cmt_ml_pool2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_jrd2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec*x_male + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .)
accpt_cmt_ml_jrd_p2 <- 
 tidy(accpt_cmt_ml_jrd2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_tns2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec*x_male + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_tns_p2 <-
 tidy(accpt_cmt_ml_tns2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_mrc2 <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec*x_male + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_mrc_p2 <-
 tidy(accpt_cmt_ml_mrc2) %>%
 filter(term %in% c("d_pro_dec", "x_male",
                    "d_pro_dec:x_male")) %>%  
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print Figure------
male_hte2 <- 
 rbind(rt_dec_ml_pool_p2, rt_dec_ml_jrd_p2, rt_dec_ml_tns_p2, rt_dec_ml_mrc_p2,
       att_cmt_ml_pool_p2, att_cmt_ml_jrd_p2, att_cmt_ml_tns_p2, att_cmt_ml_mrc_p2,
       accpt_cmt_ml_pool_p2, accpt_cmt_ml_jrd_p2, accpt_cmt_ml_tns_p2, accpt_cmt_ml_mrc_p2
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_pro_dec" ~ "Pro-Women \nDecision",
         term == "x_male" ~ "Male \nRespondent",
         term == "d_pro_dec:x_male" ~ "Pro-Women*\nMale",
        ))


# Set order of outcomes and countries
male_hte2$Sample <- factor(male_hte2$Sample, 
                           c("Pooled",
                             "Jordan",
                             "Tunisia",
                             "Morocco"
                           ))

male_hte2$Outcome <- factor(male_hte2$Outcome, 
                            c("Right \nDecision \nIndex",
                              "Attitude \nTowards \nCommittee \nIndex",
                              "Public \nAccept \nDecision"
                            ))

male_pos <- c("Pro-Women \nDecision",
              "Male \nRespondent",
              "Pro-Women*\nMale") %>% rev()

ggplot(male_hte2, aes(x=estimate, y=term, 
                      color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 scale_y_discrete(limits = male_pos)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A19-----
##Estimate regressions--------
###Outcome: Committee Made Right decision (Index)-----
rt_dec_ml_pool_male <-
 gend_domv %>% 
 filter(.,
        x_male ==1) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
rt_dec_ml_pool_male <- 
 tidy(rt_dec_ml_pool_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Pooled",
        Gender = "Male",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_pool_female <-
 gend_domv %>% 
 filter(.,
        x_male ==0) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
rt_dec_ml_pool_female <- 
 tidy(rt_dec_ml_pool_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Pooled",
        Gender = "Female",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_jrd_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan",
        x_male ==1) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_jrd_male <-
 tidy(rt_dec_ml_jrd_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Jordan",
        Gender = "Male",
        Outcome = "Right \nDecision \nIndex")




rt_dec_ml_jrd_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan",
        x_male ==0) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_jrd_female <-
 tidy(rt_dec_ml_jrd_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Jordan",
        Gender = "Female",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia",
        x_male ==1) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 

rt_dec_ml_tns_male <- 
 tidy(rt_dec_ml_tns_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Tunisia",
        Gender = "Male",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia",
        x_male ==0) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+
            x_age + x_edu,
           se_type = "HC0",
           data = .) 

rt_dec_ml_tns_female <- 
 tidy(rt_dec_ml_tns_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Tunisia",
        Gender = "Female",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_mrc_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco",
        x_male ==1) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_mrc_male<-
 tidy(rt_dec_ml_mrc_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Morocco",
        Gender = "Male",
        Outcome = "Right \nDecision \nIndex")



rt_dec_ml_mrc_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco",
        x_male ==0) %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
rt_dec_ml_mrc_female<-
 tidy(rt_dec_ml_mrc_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Morocco",
        Gender = "Female",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
att_cmt_ml_pool_male <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>%
 filter(.,
        x_male ==1) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
att_cmt_ml_pool_male <-
 tidy(att_cmt_ml_pool_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Pooled",
        Gender = "Male",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_pool_female <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>%
 filter(.,
        x_male ==0) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
att_cmt_ml_pool_female <-
 tidy(att_cmt_ml_pool_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Pooled",
        Gender = "Female",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")




att_cmt_ml_jrd_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan",
        x_male==1) %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
att_cmt_ml_jrd_male <-
 tidy(att_cmt_ml_jrd_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Jordan",
        Gender = "Male",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_jrd_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan",
        x_male==0) %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
att_cmt_ml_jrd_female <-
 tidy(att_cmt_ml_jrd_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%
 mutate(.,
        Sample = "Jordan",
        Gender = "Female",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")




att_cmt_ml_tns_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia",
        x_male ==1) %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .)
att_cmt_ml_tns_male <-
 tidy(att_cmt_ml_tns_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Gender = "Male",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_tns_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia",
        x_male == 0) %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .)
att_cmt_ml_tns_female <-
 tidy(att_cmt_ml_tns_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Gender = "Female",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco",
        x_male == 1) %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 

att_cmt_ml_mrc_male <-
 tidy(att_cmt_ml_mrc_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Morocco",
        Gender = "Male",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco",
        x_male == 0) %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .) 

att_cmt_ml_mrc_female <-
 tidy(att_cmt_ml_mrc_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Morocco",
        Gender = "Female",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



### Outcome: Acceptance of Committee Decision------

accpt_cmt_ml_pool_male <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 filter(.,
        x_male==1) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_pool_male <-
 tidy(accpt_cmt_ml_pool_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Pooled",
        Gender = "Male",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_pool_female <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 filter(.,
        x_male==0) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_pool_female <-
 tidy(accpt_cmt_ml_pool_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Pooled",
        Gender = "Female",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_jrd_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan",
        x_male == 1) %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .)
accpt_cmt_ml_jrd_male <- 
 tidy(accpt_cmt_ml_jrd_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Jordan",
        Gender = "Male",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_jrd_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan",
        x_male == 0) %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+  
            x_age + x_edu,
           se_type = "HC0",
           data = .)
accpt_cmt_ml_jrd_female <- 
 tidy(accpt_cmt_ml_jrd_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Jordan",
        Gender = "Female",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_tns_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia",
        x_male == 1) %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_tns_male <-
 tidy(accpt_cmt_ml_tns_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Gender = "Male",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_tns_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia",
        x_male == 0) %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_tns_female <-
 tidy(accpt_cmt_ml_tns_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Gender = "Female",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_mrc_male <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco",
        x_male == 1) %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_mrc_male <-
 tidy(accpt_cmt_ml_mrc_male) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%  
 mutate(.,
        Sample = "Morocco",
        Gender = "Male",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_mrc_female <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco",
        x_male == 0) %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_pro_dec + d_gen_bal+ 
            x_age + x_edu,
           se_type = "HC0",
           data = .) 
accpt_cmt_ml_mrc_female <-
 tidy(accpt_cmt_ml_mrc_female) %>%
 filter(term %in% c("d_pro_dec", "d_gen_bal")) %>%  
 mutate(.,
        Sample = "Morocco",
        Gender = "Female",
        Outcome = "Public \nAccept \nDecision")



##Print figure------
male_female_results <- 
 rbind(rt_dec_ml_pool_male, rt_dec_ml_jrd_male, rt_dec_ml_tns_male, rt_dec_ml_mrc_male,
       rt_dec_ml_pool_female, rt_dec_ml_jrd_female, rt_dec_ml_tns_female, rt_dec_ml_mrc_female,
       att_cmt_ml_pool_male, att_cmt_ml_jrd_male, att_cmt_ml_tns_male, att_cmt_ml_mrc_male,
       att_cmt_ml_pool_female, att_cmt_ml_jrd_female, att_cmt_ml_tns_female, att_cmt_ml_mrc_female,
       accpt_cmt_ml_pool_male, accpt_cmt_ml_jrd_male, accpt_cmt_ml_tns_male, accpt_cmt_ml_mrc_male,
       accpt_cmt_ml_pool_female, accpt_cmt_ml_jrd_female, accpt_cmt_ml_tns_female, accpt_cmt_ml_mrc_female
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_pro_dec" ~ "Pro-Women \nDecision",
         term == "d_gen_bal" ~ "Gender Balance",
        ))


# Set order of outcomes and countries
male_female_results$Sample <- factor(male_female_results$Sample, 
                                     c("Pooled",
                                       "Jordan",
                                       "Tunisia",
                                       "Morocco"
                                     ))

male_female_results$Outcome <- factor(male_female_results$Outcome, 
                                      c("Right \nDecision \nIndex",
                                        "Attitude \nTowards \nCommittee \nIndex",
                                        "Public \nAccept \nDecision"
                                      ))

post_mf <- c("Gender Balance", "Pro-Women \nDecision") %>% rev()

ggplot(male_female_results, aes(x=estimate, y=term, 
                                color = Gender, shape = Gender)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_grid(Sample~Outcome)+
 #scale_x_continuous(limits = -1:1) +
 scale_y_discrete(limits = post_mf)+ 
 scale_color_brewer(palette = "Set1")+
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       legend.key=element_blank(),
       axis.line = element_line(colour = "black"))


#Figure A20-------
##Estimate regressions-----
###Outcome: Committee Made Right decision (Index)-----
reg_rt_dec_pool <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
reg_rt_dec_pool_p <- 
 tidy(reg_rt_dec_pool) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


reg_rt_dec_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
reg_rt_dec_jrd_p <-
 tidy(reg_rt_dec_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


reg_rt_dec_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

reg_rt_dec_tns_p <- 
 tidy(reg_rt_dec_tns) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



reg_rt_dec_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
reg_rt_dec_mrc_p<-
 tidy(reg_rt_dec_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")



###Outcome: Attitudes Towards Committee (Index)-----
reg_att_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
reg_att_cmt_pool_p <-
 tidy(reg_att_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



reg_att_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
reg_att_cmt_jrd_p <-
 tidy(reg_att_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>%
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


reg_att_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
reg_att_cmt_tns_p <-
 tidy(reg_att_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



reg_att_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 

reg_att_cmt_mrc_p <-
 tidy(reg_att_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>%
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

reg_accpt_cmt_pool <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           fixed_effects = x_cntry,
           se_type = "HC0",
           data = .) 
reg_accpt_cmt_pool_p <-
 tidy(reg_accpt_cmt_pool) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")

reg_accpt_cmt_jrd <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .)
reg_accpt_cmt_jrd_p <- 
 tidy(reg_accpt_cmt_jrd) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


reg_accpt_cmt_tns <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
reg_accpt_cmt_tns_p <-
 tidy(reg_accpt_cmt_tns) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>%
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



reg_accpt_cmt_mrc <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal*m_regime_sat + d_pro_dec+
            x_age + x_edu +x_male,
           se_type = "HC0",
           data = .) 
reg_accpt_cmt_mrc_p <-
 tidy(reg_accpt_cmt_mrc) %>%
 filter(term %in% c("d_gen_bal", "m_regime_sat",
                    "d_gen_bal:m_regime_sat")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")


##Print figure------
reg_coef <- 
 rbind(reg_rt_dec_pool_p, reg_rt_dec_jrd_p, reg_rt_dec_tns_p, reg_rt_dec_mrc_p,
       reg_att_cmt_pool_p, reg_att_cmt_jrd_p, reg_att_cmt_tns_p, reg_att_cmt_mrc_p,
       reg_accpt_cmt_pool_p, reg_accpt_cmt_jrd_p, reg_accpt_cmt_tns_p, reg_accpt_cmt_mrc_p
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "m_regime_sat" ~ "Regime \nSatisfaction",
         term == "d_gen_bal:m_regime_sat" ~ "Balance*\nSatisfaction",
        ))


# Set order of outcomes and countries
reg_coef$Sample <- factor(reg_coef$Sample, 
                          c("Pooled",
                            "Jordan",
                            "Tunisia",
                            "Morocco"
                          ))

reg_coef$Outcome <- factor(reg_coef$Outcome, 
                           c("Right \nDecision \nIndex",
                             "Attitude \nTowards \nCommittee \nIndex",
                             "Public \nAccept \nDecision"
                           ))

reg_coef$term <- factor(reg_coef$term, 
                        c("Balance*\nSatisfaction",
                          "Regime \nSatisfaction",
                          "Gender \nBalance"
                        ))

h5b_pos <- c("Pooled",
             "Jordan",
             "Tunisia",
             "Morocco")

ggplot(reg_coef, aes(x=estimate, y=term, 
                     color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))



#Figure A21----------
##Estimate regressions
###Outcome: Committee Made Right decision (Index)-----
rt_dec_ml_pool_pn <-
 gend_domv %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec+
            x_age + x_edu + x_increase_domv_pen,
           fixed_effects = x_cntry,
           data = .)  %>% tidy() %>% 
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_jrd_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec+
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Right \nDecision \nIndex")


rt_dec_ml_tns_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Right \nDecision \nIndex")



rt_dec_ml_mrc_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_right_dec_ix = standardize(y_right_dec_ix)) %>% 
 lm_robust(y_right_dec_ix ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Right \nDecision \nIndex")

###Outcome: Attitudes Towards Committee (Index)-----
att_cmt_ml_pool_pn <-
 gend_domv %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Pooled",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_jrd_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


att_cmt_ml_tns_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")



att_cmt_ml_mrc_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_att_comittee = standardize(y_att_comittee)) %>% 
 lm_robust(y_att_comittee ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Attitude \nTowards \nCommittee \nIndex")


### Outcome: Acceptance of Committee Decision------

accpt_cmt_ml_pool_pn <-
 gend_domv %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>%  
 mutate(.,
        Sample = "Pooled",
        Outcome = "Public \nAccept \nDecision")




accpt_cmt_ml_jrd_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Jordan") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Jordan",
        Outcome = "Public \nAccept \nDecision")


accpt_cmt_ml_tns_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Tunisia") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Tunisia",
        Outcome = "Public \nAccept \nDecision")



accpt_cmt_ml_mrc_pn <-
 gend_domv %>% 
 filter(.,
        x_cntry == "Morocco") %>% 
 mutate(.,
        y_public_accept = standardize(y_public_accept)) %>% 
 lm_robust(y_public_accept ~
            d_gen_bal + x_male + d_pro_dec +
            x_age + x_edu + x_increase_domv_pen,
           se_type = "HC0",
           data = .) %>% tidy() %>%
 filter(term %in% c("d_gen_bal", "d_pro_dec")) %>% 
 mutate(.,
        Sample = "Morocco",
        Outcome = "Public \nAccept \nDecision")

##Print figure------
pre_tr_pen <- 
 rbind(rt_dec_ml_pool_pn, rt_dec_ml_jrd_pn, rt_dec_ml_tns_pn, rt_dec_ml_mrc_pn,
       att_cmt_ml_pool_pn, att_cmt_ml_jrd_pn, att_cmt_ml_tns_pn, att_cmt_ml_mrc_pn,
       accpt_cmt_ml_pool_pn, accpt_cmt_ml_jrd_pn, accpt_cmt_ml_tns_pn, accpt_cmt_ml_mrc_pn
 ) %>% 
 mutate(.,
        term = case_when(
         term == "d_gen_bal" ~ "Gender \nBalance",
         term == "d_pro_dec" ~ "Pro Women \nDecision"
        ))


# Set order of outcomes and countries
pre_tr_pen$Sample <- factor(pre_tr_pen$Sample, 
                            c("Pooled",
                              "Jordan",
                              "Tunisia",
                              "Morocco"
                            ))

pre_tr_pen$Outcome <- factor(pre_tr_pen$Outcome, 
                             c("Right \nDecision \nIndex",
                               "Attitude \nTowards \nCommittee \nIndex",
                               "Public \nAccept \nDecision"
                             ))

enum_pos <- c("Gender \nBalance",
              "Pro Women \nDecision") %>% rev()

ggplot(pre_tr_pen, aes(x=estimate, y=term, 
                       color = Sample, shape = Sample)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high), 
                 position = position_dodge(width = 0.4)) +
 facet_wrap(~ Outcome)+
 scale_y_discrete(limits = enum_pos)+ 
 labs(x = "Effects Size",
      y = "",
      color = "",
      shape = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


#Figure A22------
## Estimate regression-----

corr_outcome <-
 gend_domv %>% 
 mutate(.,
        x_increase_domv_pen = case_when(
         x_increase_domv_pen == "Yes"~ 1,
         x_increase_domv_pen == "No"~ 0
        )) %>% 
 lm_robust(as.numeric(x_increase_domv_pen)~ m_sexism_ix + m_norms_ix +m_regime_sat+
            x_male,
           data = .) %>% tidy() %>% 
 filter(.,
        term != "(Intercept)") %>% 
 mutate(.,
        term = case_when(
         term == "m_sexism_ix" ~ "Sexism \nIndex", 
         term == "m_norms_ix" ~ "Liberal \nNorms", 
         term == "m_regime_sat" ~ "Regime \nSatisfaction", 
         term == "x_male" ~ "Male"
        ))

##Print Figure-----

ggplot(corr_outcome, aes(x=estimate, y=term)) +
 geom_vline(xintercept = 0, color = "gray50", linetype = 2, size = 0.2) +
 geom_pointrange(aes(xmin = conf.low, xmax = conf.high)) +
 #scale_x_continuous(limits = -1:1) +
 #  scale_x_discrete(limits = positions_h3)+ 
 labs(x = "Effects Size",
      y = "") +
 theme(text = element_text(size = 12, family = "Times"),
       legend.position = "bottom",
       panel.grid.major = element_blank(), 
       axis.text.x = element_text(size = 12),
       plot.caption = element_text(size = 10, family = "Times",hjust = -.02),
       panel.grid.minor = element_blank(),
       panel.background = element_blank(), 
       axis.line = element_line(colour = "black"))


